home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / xaw / formp.h < prev    next >
C/C++ Source or Header  |  1999-01-01  |  4KB  |  123 lines

  1. /* $XConsortium: FormP.h,v 1.20 91/05/02 16:20:29 swick Exp $ */
  2. /* Copyright    Massachusetts Institute of Technology    1987 */
  3.  
  4.  
  5. /***********************************************************
  6. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  7. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  8.  
  9.                         All Rights Reserved
  10.  
  11. Permission to use, copy, modify, and distribute this software and its 
  12. documentation for any purpose and without fee is hereby granted, 
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in 
  15. supporting documentation, and that the names of Digital or MIT not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.  
  18.  
  19. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26.  
  27. ******************************************************************/
  28.  
  29. /* Form widget private definitions */
  30.  
  31. #ifndef _XawFormP_h
  32. #define _XawFormP_h
  33.  
  34. #include <X11/Xaw/Form.h>
  35. #include <X11/ConstrainP.h>
  36.  
  37. #define XtREdgeType "EdgeType"
  38.  
  39. typedef enum {LayoutPending, LayoutInProgress, LayoutDone} LayoutState;
  40. #define XtInheritLayout ((Boolean (*)())_XtInherit)
  41.  
  42. typedef struct {
  43.     Boolean    (*layout)(/* FormWidget, Dimension, Dimension */);
  44. } FormClassPart;
  45.  
  46. /*
  47.  * Layout(
  48.  *    FormWidget w    - the widget whose children are to be configured
  49.  *    Dimension w, h    - bounding box of layout to be calculated
  50.  *
  51.  *  Stores preferred geometry in w->form.preferred_{width,height}.
  52.  *  If w->form.resize_in_layout is True, then a geometry request
  53.  *  may be made for the preferred bounding box if necessary.
  54.  *
  55.  *  Returns True if a geometry request was granted, False otherwise.
  56.  */
  57.  
  58. typedef struct _FormClassRec {
  59.     CoreClassPart    core_class;
  60.     CompositeClassPart    composite_class;
  61.     ConstraintClassPart    constraint_class;
  62.     FormClassPart    form_class;
  63. } FormClassRec;
  64.  
  65. extern FormClassRec formClassRec;
  66.  
  67. typedef struct _FormPart {
  68.     /* resources */
  69.     int        default_spacing;    /* default distance between children */
  70.     /* private state */
  71.     Dimension    old_width, old_height; /* last known dimensions         */
  72.     int        no_refigure;        /* no re-layout while > 0         */
  73.     Boolean    needs_relayout;        /* next time no_refigure == 0     */
  74.     Boolean    resize_in_layout;   /* should layout() do geom request?  */
  75.     Dimension    preferred_width, preferred_height; /* cached from layout */
  76.     Boolean     resize_is_no_op;    /* Causes resize to take not action. */
  77. } FormPart;
  78.  
  79. typedef struct _FormRec {
  80.     CorePart        core;
  81.     CompositePart    composite;
  82.     ConstraintPart    constraint;
  83.     FormPart        form;
  84. } FormRec;
  85.  
  86. typedef struct _FormConstraintsPart {
  87. /*
  88.  * Constraint Resources.
  89.  */
  90.     XtEdgeType    top, bottom,    /* where to drag edge on resize        */
  91.         left, right;
  92.     int        dx;        /* desired horiz offset            */
  93.     int        dy;        /* desired vertical offset        */
  94.     Widget    horiz_base;    /* measure dx from here if non-null    */
  95.     Widget    vert_base;    /* measure dy from here if non-null    */
  96.     Boolean    allow_resize;    /* TRUE if child may request resize    */
  97.  
  98. /*
  99.  * Private contstraint resources.
  100.  */
  101.  
  102. /*
  103.  * What the size of this child would be if we did not impose the 
  104.  * constraint the width and height must be greater than zero (0).
  105.  */
  106.     short    virtual_width, virtual_height;
  107.  
  108. /*
  109.  * Temporary Storage for children's new possible possition.
  110.  */
  111.  
  112.     Position new_x, new_y;
  113.  
  114.     LayoutState    layout_state;    /* temporary layout state        */
  115.     Boolean    deferred_resize; /* was resized while no_refigure is set */
  116. } FormConstraintsPart;
  117.  
  118. typedef struct _FormConstraintsRec {
  119.     FormConstraintsPart    form;
  120. } FormConstraintsRec, *FormConstraints;
  121.  
  122. #endif /* _XawFormP_h */
  123.